<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>crossdomainrpc.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
  </script>

  <script src="static/js/doc.js">
  </script>

  <meta charset="utf8">
</head>

<body onload="prettyPrint()">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">crossdomainrpc.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Cross domain RPC library using the <a
 href="http://go/xd2_design" target="_top">XD2 approach</a>.

 <h5>Protocol</h5>
 Client sends a request across domain via a form submission.  Server
 receives these parameters: &quot;xdpe:request-id&quot;, &quot;xdpe:dummy-uri&quot; (&quot;xdpe&quot; for
 &quot;cross domain parameter to echo back&quot;) and other user parameters prefixed
 with &quot;xdp&quot; (for &quot;cross domain parameter&quot;).  Headers are passed as parameters
 prefixed with &quot;xdh&quot; (for &quot;cross domain header&quot;).  Only strings are supported
 for parameters and headers.  A GET method is mapped to a form GET.  All
 other methods are mapped to a POST.  Server is expected to produce a
 HTML response such as the following:
 <pre class="lang-js">
 &lt;body&gt;
 &lt;script type=&quot;text/javascript&quot;
 src=&quot;path-to-crossdomainrpc.js&quot;&gt;&lt;/script&gt;
 var currentDirectory = location.href.substring(
 0, location.href.lastIndexOf(&#39;/&#39;)
 );

 // echo all parameters prefixed with &quot;xdpe:&quot;
 var echo = {};
 echo[goog.net.CrossDomainRpc.PARAM_ECHO_REQUEST_ID] =
 &lt;value of parameter &quot;xdpe:request-id&quot;&gt;;
 echo[goog.net.CrossDomainRpc.PARAM_ECHO_DUMMY_URI] =
 &lt;value of parameter &quot;xdpe:dummy-uri&quot;&gt;;

 goog.net.CrossDomainRpc.sendResponse(
 &#39;({&quot;result&quot;:&quot;&lt;responseInJSON&quot;})&#39;,
 true,    // is JSON
 echo,    // parameters to echo back
 status,  // response status code
 headers  // response headers
 );
 &lt;/script&gt;
 &lt;/body&gt;
 </pre>

 <h5>Server Side</h5>
 For an example of the server side, refer to the following files:
 <ul>
 <li><a href="http://go/xdservletfilter.java">http://go/xdservletfilter.java</a></li>
 <li><a href="http://go/xdservletrequest.java">http://go/xdservletrequest.java</a></li>
 <li><a href="http://go/xdservletresponse.java">http://go/xdservletresponse.java</a></li>
 </ul>

 <h5>System Requirements</h5>
 Tested on IE6, IE7, Firefox 2.0 and Safari nightly r23841.
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_net_crossdomainrpc.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">net/crossdomainrpc.js</div>
    </div>
  </div>
<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_net_CrossDomainRpc.html">
          goog.net.CrossDomainRpc</a><br/>
        <div class="class-details">Creates a new instance of cross domain RPC</div>
 </div>
      
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>


  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.createInputHtml_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">createInputHtml_<span class="args">(<span class="arg">name</span>,&nbsp;<span class="arg">value</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Creates the HTML of an input element
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">name</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Name of input element.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">value</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
        <div class="entryOverview">Value of input element.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            HTML of input element with that name and value.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line212">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.createResponseInfo_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">createResponseInfo_<span class="args">(<span class="arg">dummyUri</span>,&nbsp;<span class="arg">numChunks</span>,&nbsp;<span class="arg">isDataJson</span>,&nbsp;<span class="arg">status</span>,&nbsp;<span class="arg">headers</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Creates a response info iframe to indicate completion of sendResponse
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dummyUri</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">URI to a dummy resource.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">numChunks</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Total number of chunks.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">isDataJson</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">Whether response is a JSON string or just string.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">status</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">HTTP response status code.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">headers</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Response headers in JSON format.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line780">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.escapeAmpersand_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">escapeAmpersand_<span class="args">(<span class="arg">value</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
      </div>


     <div class="entryOverview">
       Escapes ampersand so that XML/HTML entities are submitted as is because
browser unescapes them when they are put into a text area.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">value</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
        <div class="entryOverview">Value to escape.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>&nbsp;
            Value with ampersand escaped, if value is a string; otherwise the value itself is returned.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line226">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.getDummyResourceUri_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">getDummyResourceUri_<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Finds a dummy resource that can be used by response to gain domain of
requester&#39;s page.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            URI of the resource to use.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line238">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.getFramePayload_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">getFramePayload_<span class="args">(<span class="arg">frame</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the payload of a frame (value after # or ? on the URL).  This value
is URL encoded except IE, where the value is not encoded to begin with.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">frame</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
        <div class="entryOverview">Frame.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Payload of that frame.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line576">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.getPayloadDelimiter_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">getPayloadDelimiter_<span class="args">(<span class="arg">dummyUri</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns payload delimiter, either &quot;#&quot; when caller&#39;s page is not used as
the dummy resource or &quot;?&quot; when it is, in which case caching issues prevent
response frames to gain the caller&#39;s domain.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dummyUri</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">URI to resource being used as dummy resource.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Either &quot;?&quot; when caller&#39;s page is used as dummy resource or &quot;#&quot; if it is not.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line801">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.isInResponseIframe_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">isInResponseIframe_<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type">*</span></div>
      </div>


     <div class="entryOverview">
       Checks to see if we are executing inside a response iframe.  This is the
case when this page is used as a dummy resource to gain caller&#39;s domain.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">*</span></div>&nbsp;
            True if we are executing inside a response iframe; false otherwise.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line113">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.isResponseInfoFrame_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">isResponseInfoFrame_<span class="args">(<span class="arg">frame</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
      </div>


     <div class="entryOverview">
       Checks whether a frame is response info frame.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">frame</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
        <div class="entryOverview">Frame to check.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>&nbsp;
            True if frame is a response info frame; false otherwise.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line557">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.removeHash_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">removeHash_<span class="args">(<span class="arg">uri</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Removes everything at and after hash from URI
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">uri</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Uri to to remove hash.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Uri with its hash and all characters after removed.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line300">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.removeUriParams_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">removeUriParams_<span class="args">(<span class="arg">uri</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Removes all parameters (after ? or #) from URI.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">uri</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">URI to remove parameters from.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            URI with all parameters removed.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line812">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.send"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">send<span class="args">(<span class="arg">uri</span>,&nbsp;<span class="arg">opt_continuation</span>,&nbsp;<span class="arg">opt_method</span>,&nbsp;<span class="arg">opt_params</span>,&nbsp;<span class="arg">opt_headers</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sends a request across domain.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">uri</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Uri to make request to.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_continuation</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span></div>
        <div class="entryOverview">Continuation function to be called when request is completed.  Takes one argument of an event object whose target has the following properties: &quot;status&quot; is the HTTP response status code, &quot;responseText&quot; is the response text, and &quot;headers&quot; is an object with all response headers.  The event target&#39;s getResponseJson() method returns a JavaScript object evaluated from the JSON response or undefined if response is not JSON.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_method</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Method of request. Default is POST.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_params</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
        <div class="entryOverview">Parameters. Each property is turned into a request parameter.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_headers</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
        <div class="entryOverview">Map of headers of the request.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line174">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.sendResponse"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">sendResponse<span class="args">(<span class="arg">data</span>,&nbsp;<span class="arg">isDataJson</span>,&nbsp;<span class="arg">echo</span>,&nbsp;<span class="arg">status</span>,&nbsp;<span class="arg">headers</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Makes response available for grandparent (requester)&#39;s receiveResponse
call to pick up by creating a series of iframes pointed to the dummy URI
with a payload (value after either ? or #) carrying a chunk of response
data and a response info iframe that tells the grandparent (requester) the
readiness of response.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">data</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Response data (string or JSON string).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">isDataJson</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">true if data is a JSON string; false if just a string.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">echo</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
        <div class="entryOverview">Parameters to echo back &quot;xdpe:request-id&quot;: Server that produces the response needs to copy it here to support multiple current XD requests on the same page. &quot;xdpe:dummy-uri&quot;: URI to a dummy resource that response iframes point to to gain the domain of the client.  This can be an image (IE) or a CSS file (FF) found on the requester&#39;s page. Server should copy value from request parameter &quot;xdpe:dummy-uri&quot;.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">status</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">HTTP response status code.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">headers</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Response headers in JSON format.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line691">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.setDebugMode"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">setDebugMode<span class="args">(<span class="arg">flag</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets debug mode to true or false.  When debug mode is on, response iframes
are visible and left behind after their use is finished.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">flag</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">Flag to indicate intention to turn debug model on (true) or off (false).</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line191">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.setDummyResourceUri"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">setDummyResourceUri<span class="args">(<span class="arg">dummyResourceUri</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the URI for a dummy resource on caller&#39;s domain.  This function is
used for specifying a particular resource to use rather than relying on
auto detection.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dummyResourceUri</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">URI to dummy resource on the same domain of caller&#39;s page.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line143">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.setUseFallBackDummyResource"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">setUseFallBackDummyResource<span class="args">(<span class="arg">useFallBack</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets whether a fallback dummy resource (&quot;/robots.txt&quot; on Firefox and Safari
and current page on IE) should be used when a suitable dummy resource is
not available.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">useFallBack</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">Whether to use fallback or not.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line154">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.HEADER"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">HEADER</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Header prefix.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line321">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.MAX_CHUNK_SIZE_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">MAX_CHUNK_SIZE_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       Maximal chunk size.  IE can only handle 4095 bytes on its URL.
16MB has been tested on Firefox.  But 1MB is a practical size.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line650">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Parameter prefix.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line328">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM_CHUNK_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM_CHUNK_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Query parameter &#39;chunk&#39;.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line659">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM_ECHO"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM_ECHO</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Parameter to echo prefix.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line335">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM_ECHO_DUMMY_URI"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM_ECHO_DUMMY_URI</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Parameter to echo: dummy resource URI
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line350">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM_ECHO_REQUEST_ID"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM_ECHO_REQUEST_ID</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Parameter to echo: request id
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line342">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.REFERRER_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">REFERRER_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Referrer of current document with all parameters after &quot;?&quot; and &quot;#&quot; stripped.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line845">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.REQUEST_MARKER_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">REQUEST_MARKER_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Cross-domain request marker.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line359">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.RESPONSE_INFO_MARKER_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">RESPONSE_INFO_MARKER_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Name of response info iframe.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line640">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.RESPONSE_MARKER_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">RESPONSE_MARKER_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Cross-domain response iframe marker.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line95">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.RESPONSE_POLLING_PERIOD_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">RESPONSE_POLLING_PERIOD_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       period of response polling (ms)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line443">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.SEND_RESPONSE_TIME_OUT_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">SEND_RESPONSE_TIME_OUT_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       timeout from response comes back to sendResponse is called (ms)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line451">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.logger_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">logger_</span>
        : <div class="fullType"><span class="type"><a href="class_goog_debug_Logger.html">goog.debug.Logger</a></span></div>
     </div>


     <div class="entryOverview">
       Logger for goog.net.CrossDomainRpc
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line201">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.nextRequestId_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">nextRequestId_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       next request id used to support multiple XD requests at the same time
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line314">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.useFallBackDummyResource_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">useFallBackDummyResource_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
     </div>


     <div class="entryOverview">
       Use a fallback dummy resource if none specified or detected.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line103">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory net</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="closure/goog" current="net/crossdomainrpc.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
